<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>count down</title>
</head>
<body>
    <div id="showleft">
        <label type="text">距离倒计时还剩： </label>
        <label id="dayleft"></label>
        <label>天</label>
        <label id="hourleft"></label>
        <label>小时</label>
        <label id="minleft"></label>
        <label>分钟</label>
        <label id="secleft"></label>
        <label>秒</label>
    </div>
</body>
<script>
    var dayleft = document.getElementById("dayleft");
    var hourleft = document.getElementById("hourleft");
    var minleft = document.getElementById("minleft");
    var secleft = document.getElementById("secleft");
    var showleft = document.getElementById("showleft");

    countdown();

    function countdown ()
    {
        var tardate = new Date("2023/11/11");
        var curdate = new Date();
        var lefttime = tardate.getTime() - curdate.getTime();
        if(lefttime > 0)
        {
            dayleft.innerHTML = Math.floor(lefttime / (1000*60*60*24));
            hourleft.innerHTML = Math.floor(lefttime / (1000*60*60) % 24);
            minleft.innerHTML = Math.floor(lefttime / (1000*60) % 60);
            secleft.innerHTML = Math.floor(lefttime / 1000 % 60);
        }
    }
00333
    setInterval(countdown, 1000);

</script>
</html>